package com.ruoyi.whzj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.whzj.mapper.WhPointspackageMapper;
import com.ruoyi.whzj.domain.WhPointspackage;
import com.ruoyi.whzj.service.IWhPointspackageService;
import com.ruoyi.common.core.text.Convert;

/**
 * 积分套餐Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-11-03
 */
@Service
public class WhPointspackageServiceImpl implements IWhPointspackageService 
{
    @Autowired
    private WhPointspackageMapper whPointspackageMapper;

    /**
     * 查询积分套餐
     * 
     * @param id 积分套餐ID
     * @return 积分套餐
     */
    @Override
    public WhPointspackage selectWhPointspackageById(String id)
    {
        return whPointspackageMapper.selectWhPointspackageById(id);
    }

    /**
     * 查询积分套餐列表
     * 
     * @param whPointspackage 积分套餐
     * @return 积分套餐
     */
    @Override
    public List<WhPointspackage> selectWhPointspackageList(WhPointspackage whPointspackage)
    {
        return whPointspackageMapper.selectWhPointspackageList(whPointspackage);
    }

    /**
     * 新增积分套餐
     * 
     * @param whPointspackage 积分套餐
     * @return 结果
     */
    @Override
    public int insertWhPointspackage(WhPointspackage whPointspackage)
    {
        whPointspackage.setId(IdWorker.getId());
        whPointspackage.setCreateTime(DateUtils.getNowDate());
        return whPointspackageMapper.insertWhPointspackage(whPointspackage);
    }

    /**
     * 修改积分套餐
     * 
     * @param whPointspackage 积分套餐
     * @return 结果
     */
    @Override
    public int updateWhPointspackage(WhPointspackage whPointspackage)
    {
        whPointspackage.setUpdateTime(DateUtils.getNowDate());
        return whPointspackageMapper.updateWhPointspackage(whPointspackage);
    }

    /**
     * 删除积分套餐对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWhPointspackageByIds(String ids)
    {
        return whPointspackageMapper.deleteWhPointspackageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除积分套餐信息
     * 
     * @param id 积分套餐ID
     * @return 结果
     */
    @Override
    public int deleteWhPointspackageById(String id)
    {
        return whPointspackageMapper.deleteWhPointspackageById(id);
    }
}
